package pl.hexar.model;

import java.io.Serializable;
import java.util.Date;

import javax.management.Query;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityManager;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.GeneratedValue;
import javax.persistence.Version;

import org.hibernate.validator.Email;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

@Entity
@Table(name="TMPUSERS")
@NamedQueries({@NamedQuery(name="TmpUser.findByLogin",query="SELECT t FROM TmpUser t WHERE t.login=:login")
			  ,@NamedQuery(name="TmpUser.findByEmail",query="SELECT t FROM TmpUser t WHERE t.email=:email")})
public class TmpUser implements Serializable {
	private String login;
	private String email;
	private String password;
	private Date regDate;

	public TmpUser() {
	}

	@Id
	@Column(length = 30)
	@Length(min = 5, max = 30)
	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
			this.login = login;
	}


	@Email
	@Column(length = 50, unique = true)
	@Length(min = 5, max = 50)
	@NotNull
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(length = 40)
	@Length(min = 5, max = 40)
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Date getRegDate() {
		return regDate;
	}

	public void setRegDate(Date regDate) {
		this.regDate = regDate;
	}

}
